/*
package com.yyw.yyw.ft_viewimgs

import android.os.Bundle
import android.view.View
import androidx.core.view.ViewCompat
import androidx.viewpager.widget.ViewPager
import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route
import com.yyw.yyw.lib_base.base.extras.onClick
import com.yyw.yyw.lib_base.config.RConfig
import com.yyw.yyw.mvp_ui.MvpActivity
import kotlinx.android.synthetic.main.activity_view_images.*


@Route(path = RConfig.FtViewImgs.viewImgs)
class ViewImagesActivity : MvpActivity() {

    //ARouter 参数传递
    @JvmField
    @Autowired
    var curPos: Int = 0

    @JvmField
    @Autowired
    var imgList: ArrayList<String>? = null

    override fun getLayoutId(): Int = R.layout.activity_view_images

    override fun isTransStatusBar(): Boolean = true

    private var isFirst = true

    override fun initView(savedInstanceState: Bundle?) {
        supportPostponeEnterTransition()

        fl_root.onClick {
            onBackPressed()
        }

        if(null == imgList){
            finish()
            return
        }

        imgList?.let {imgs->
            ViewCompat.setTransitionName(vp_img, imgs[curPos])

            var showIndicator = true
            if(imgs.size <= 1){
                showIndicator = false
            }
            if(showIndicator) {
                pageIndicatorView.count = imgs.size // specify total count of indicators
                pageIndicatorView.selection = curPos
            }else{
                pageIndicatorView.visibility = View.GONE
            }
            vp_img.pageMargin = (resources.displayMetrics.density * 15).toInt()
            vp_img.adapter = DraweePagerAdapter(imgs, {
                onBackPressed()
            }, {
                if(isFirst) {
                    isFirst = false
                    supportStartPostponedEnterTransition()
                }
            })
            vp_img.offscreenPageLimit = imgs.size
            vp_img.currentItem = curPos
            vp_img.addOnPageChangeListener(object : ViewPager.OnPageChangeListener{
                override fun onPageScrollStateChanged(state: Int) {}

                override fun onPageScrolled(
                    position: Int,
                    positionOffset: Float,
                    positionOffsetPixels: Int
                ) {}

                override fun onPageSelected(position: Int) {
                    if(showIndicator) {
                        pageIndicatorView.selection = position
                    }
                }

            })
        }

        */
/*vp_img.viewTreeObserver.addOnGlobalLayoutListener(object : OnGlobalLayoutListener {
            override fun onGlobalLayout() {
                vp_img.viewTreeObserver.removeOnGlobalLayoutListener(this)
                supportStartPostponedEnterTransition()
            }
        })*//*


    }
}
*/
